package demo;

import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.plugin.redis.RedisPlugin;
import com.jfinal.render.ViewType;

import demo.inteceptor.GlobleInteceptor;
import demo.routes.AdminRoutes;
import demo.routes.FromtRoutes;

public class DemoConfig extends JFinalConfig {

	@Override
	public void configConstant(Constants me) {
		// TODO Auto-generated method stub
		me.setDevMode(true);
		me.setViewType(ViewType.JSP);
		//PropKit.use("");
	}

	@Override
	public void configRoute(Routes me) {
		// TODO Auto-generated method stub
		//me.add("/hello", HelloController.class);
		me.add(new FromtRoutes());
		me.add(new AdminRoutes());
	}

	@Override
	public void configHandler(Handlers me) {
		// TODO Auto-generated method stub

	}

	@Override
	public void configInterceptor(Interceptors me) {
		// TODO Auto-generated method stub
		me.addGlobalActionInterceptor(new GlobleInteceptor());
	}

	@Override
	public void configPlugin(Plugins me) {
		// TODO Auto-generated method stub
		RedisPlugin bbsRedis = new RedisPlugin("bbs", "localhost");
		me.add(bbsRedis);
	}
}
